﻿namespace AnalyStock.DataManage;

internal class ErrorLogPool
{
    //失败记录集合
    internal static IList<ErrorLog> ErrorLogs { get; set; }

    /// <summary>
    ///     失败记录导入
    /// </summary>
    /// <param name="processName"></param>
    /// <param name="stockcode"></param>
    /// <param name="tradedate"></param>
    /// <param name="errmessage"></param>
    public static void LogErrorMessage(string processName,
                                       string stockCode,
                                       string tradeDate,
                                       string errMessage)
    {
        ErrorLogs.Add(new ErrorLog
        {
            ProcessName = processName,
            LogDateTime = DateTime.Today.ToString("f"),
            StockCode = stockCode,
            StockTradeDate = tradeDate,
            ErrLogs = errMessage
        });
    }
}

//数据处理过程中的错误记录类
public class ErrorLog
{
    public string ProcessName { get; set; }
    public string LogDateTime { get; set; }
    public string StockCode { get; set; }
    public string StockTradeDate { get; set; }
    public string ErrLogs { get; set; }
}